package cs.sasu.service.Impl;

import cs.sasu.mapper.SystemRoleMapper;
import cs.sasu.pojo.SystemRole;
import cs.sasu.service.SystemRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SystemRoleServiceImpl implements SystemRoleService {
    @Autowired
    private SystemRoleMapper systemRoleMapper;
    @Override
    public boolean save(SystemRole role) {
        try {
            return systemRoleMapper.save(role);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public SystemRole get(String i) {
        try {
            return systemRoleMapper.get(i);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public int update(SystemRole role) {
        try {
            return systemRoleMapper.update(role);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public boolean delete(String number) {
        try {
            return systemRoleMapper.delete(number) > 0;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public boolean remove(String number) {
        try {
            return systemRoleMapper.remove(number) > 0;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
